home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0429.dms / q0429.adf / libray / libobj / bounds.h < prev    next >
C/C++ Source or Header  |  1991-08-08  |  1KB  |  55 lines

  1. /*
  2.  * bounds.h
  3.  *
  4.  * Copyright (C) 1989, 1991, Craig E. Kolb
  5.  * All rights reserved.
  6.  *
  7.  * This software may be freely copied, modified, and redistributed
  8.  * provided that this copyright notice is preserved on all copies.
  9.  *
  10.  * You may not distribute this software, in whole or in part, as part of
  11.  * any commercial product without the express consent of the authors.
  12.  *
  13.  * There is no warranty or other guarantee of fitness of this software
  14.  * for any purpose.  It is provided solely "as is".
  15.  *
  16.  * $Id: bounds.h,v 4.0 91/07/17 14:36:26 kolb Exp Locker: kolb $
  17.  *
  18.  * $Log:    bounds.h,v $
  19.  * Revision 4.0  91/07/17  14:36:26  kolb
  20.  * Initial version.
  21.  * 
  22.  */
  23. #ifndef BOUNDS_H
  24. #define BOUNDS_H
  25.  
  26. /*
  27.  * Used to make indices into bounding box arrays more readable.
  28.  */
  29. #define X    0
  30. #define Y    1
  31. #define Z    2
  32. #define LOW    0
  33. #define HIGH    1
  34.  
  35. /*
  36.  * If minimum X is greater than maximum, then
  37.  * is considered to be unbounded.
  38.  */
  39.  
  40. #define UNBOUNDED(o)    ((o)->bounds[LOW][X] > (o)->bounds[HIGH][X])
  41.  
  42. /*
  43.  * Is the point p outside of the bounding box "b"?
  44.  */
  45. #define OutOfBounds(p,b) ((p)->x < b[0][0] || (p)->x > b[1][0] ||\
  46.               (p)->y < b[0][1] || (p)->y > b[1][1] ||\
  47.               (p)->z < b[0][2] || (p)->z > b[1][2])
  48.  
  49. extern void     BoundsCopy(), BoundsPrint(),
  50.         BoundsInit(), BoundsEnlarge(),
  51.         BoundsTransform();
  52.  
  53. extern int    BoundsIntersect();
  54. #endif /* BOUNDS_H */
  55.